home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 598 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: tbj.dec.com!diamond
  2. From: diamond@tbj.dec.com (Norman Diamond)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Bit-field sizes
  5. Date: 19 Mar 1996 02:58:33 GMT
  6. Organization: Digital Equipment Corporation Japan , Tokyo
  7. Message-ID: <4il7sp$dgp@usenet.pa.dec.com>
  8. References: <nzRPxQ9ytZZA084yn@csn.net> <4hkgds$bbh@info1.sdrc.com> <4ho846$g2d@usenet.pa.dec.com> <4hpkcv$gjc@info1.sdrc.com> <827022001snz@genesis.demon.co.uk>
  9. Reply-To: diamond@tbj.dec.com (Norman Diamond)
  10. NNTP-Posting-Host: jit533.tbj.dec.com
  11.  
  12. In article <827022001snz@genesis.demon.co.uk>, Lawrence Kirby <fred@genesis.demon.co.uk> writes:
  13. >In article <4hpkcv$gjc@info1.sdrc.com> larry.jones@sdrc.com "Larry Jones" writes:
  14. >>Sure they can -- once you've declared a bit-field with a non-conforming
  15. >>type you've invoked undefined behavior and the compiler is at liberty to
  16. >>do anything it likes from then on.
  17.  
  18. >Lets say (with reference to 6.5.2.1) I declare:
  19. >  struct bit { long field : CHAR_BIT*sizeof(long) + 1; };
  20. >This results in undefined behaviour due to the long type of the declarator.
  21. >However a constraint is also violated due to the field width. Is a diagnostic
  22. >still required in this case or can the compiler omit it as a form of undefined
  23. >behaviour?
  24.  
  25. If I understand correctly, a technical corrigendum requires that a
  26. diagnostic be issued for a translation unit which violates any syntax
  27. rule or constraint, even if violations of other clauses occur "earlier"
  28. in the translation unit.
  29.  
  30. From one point of view, I am glad to see that requirement.  From a
  31. different point of view, I fear that even highest quality implementations
  32. are now forced to issue a blanket warning at the beginning of translation.
  33. --
  34.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  35. "I paid money for this car, I pay taxes for vehicle registration and a driver's
  36. license, so I can drive in any lane I want, and no innocent victim gets to call
  37. the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
  38.